import axios from 'axios'
import fs from 'node:fs'
async function  downloadFfile() {
  const writeStream = fs.createWriteStream('./music/1.jpg')
  const res =await axios.get('https://img01.dmhmusic.com/0513/M00/C1/B7/ChAKFGRHfkuAVHblAASpAXJ0MoU385.jpg@w_300,h_300', { responseType: 'stream' },)
  console.log(res);
  res.data.pipe(writeStream)
  res.data.on('close', () => {
    console.log('流文件关闭');
  })
  
}
downloadFfile()